/**
 * 将 00:00 转换成纯秒数
 */
export const convert = (time)=>{
  if(""===time.trim()){
    return 0;
  }
  let min = time.split(':')[0] * 60
  let sec = parseFloat(time.split(':')[1]);
  let result = parseInt(min+sec);
  if(isNaN(result)){
    console.log("时间转换异常：" ,time);
  }else{
    return result;
  }
}

/**
 * 将纯秒数转换为 00:00
 */
export const reverseConvert = (time) => {
  let min = parseInt(time / 60);
  let sec = parseInt(time%60);
  if(min<10) min = '0'+min;
  if(sec<10) sec = '0'+sec;
  return min +':'+sec;
}

/**
 * 根据毫秒值返回一个标准日期格式
 * @param {毫秒值} time 
 */
export const dateConvert = (time) => {
  return new Date(time).toLocaleString();
}